/*
 * Copyright (c) 2022, tyustli
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-08     tyustli      first implementation
 */

#include <stdio.h>
#include <math.h>

static char prime_num(int value)
{

    int i = 2;
    for (i = 2; i < value; i++)
    {
        if (value % i == 0)
            return 0;
    }

    return 1;
}
static char prime_sum(int value)
{
    int temp_data = 0;

    for (int n = 1; n < value; n++)
    {
        temp_data = value - n;
        if (prime_num(n) && prime_num(temp_data))
        {
            return 1;
        }
    }

    return 0;
}
int main(int argc, char **argv)
{
    printf("%d is prime sum ?:%d\r\n",1, prime_sum(1));
    printf("%d is prime sum ?:%d\r\n",2, prime_sum(2));
    printf("%d is prime sum ?:%d\r\n",3, prime_sum(3));
    printf("%d is prime sum ?:%d\r\n",4, prime_sum(4));
    printf("%d is prime sum ?:%d\r\n",5, prime_sum(5));
    printf("%d is prime sum ?:%d\r\n",6, prime_sum(6));
    printf("%d is prime sum ?:%d\r\n",7, prime_sum(7));
    printf("%d is prime sum ?:%d\r\n",8, prime_sum(8));
    printf("%d is prime sum ?:%d\r\n",9, prime_sum(9));
    printf("%d is prime sum ?:%d\r\n",10, prime_sum(10));
    printf("%d is prime sum ?:%d\r\n",34, prime_sum(34));

    return 1;
}

/******************** end of file **********************/
